package cn.meye11.crm.domain.model;

import cn.meye11.crm.common.DateUtils;
import cn.meye11.crm.domain.entity.MemberEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 会员信息表(Member)模型类
 *
 * @author makejava
 * @since 2023-11-11 13:33:57
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//@ApiModel("会员信息表")
public class Member implements Serializable {

    private static final long serialVersionUID = 436658298534421236L;
    
    public Member(MemberEntity entity) {
        BeanUtils.copyProperties(entity, this);
    }
    
    //@ApiModelProperty(value = "会员id")
    private Long id;
    //@ApiModelProperty(value = "姓名")
    private String name;
    //@ApiModelProperty(value = "手机")
    private String mobile;
    private Double rechargeBalance;
    //@ApiModelProperty(value = "赠送余额")
    private Double giftBalance;
    /* 充值次数 */
    private Integer times;
    //@ApiModelProperty(value = "邮箱")
    private String mail;
    //@ApiModelProperty(value = "地址")
    private String address;
    //@ApiModelProperty(value = "性别")
    private String sex;
    //@ApiModelProperty(value = "生日")
    @JsonFormat(pattern = DateUtils.FORMAT_PATTERN_DATE)
    @DateTimeFormat(pattern = DateUtils.FORMAT_PATTERN_DATE)
    private Date birthday;
    //@ApiModelProperty(value = "注册日期")
    @JsonFormat(pattern = DateUtils.FORMAT_PATTERN_DATE)
    @DateTimeFormat(pattern = DateUtils.FORMAT_PATTERN_DATE)
    private Date registrationDate;
    //@ApiModelProperty(value = "会员类型")
    private String memberType;
    //@ApiModelProperty(value = "会员积分")
    private Integer integral;
    //@ApiModelProperty(value = "客户经理")
    private String accountManager;
    //@ApiModelProperty(value = "客户画像标签")
    private String label;
    //@ApiModelProperty(value = "是否删除", hidden = true)
    private Integer del;
    //@ApiModelProperty(value = "最后修改时间", notes = "yyyy-MM-dd HH:mm:ss", example = "2020-01-01 00:00:00", hidden = true)
    private LocalDateTime last;
    //@ApiModelProperty(value = "创建时间", notes = "yyyy-MM-dd HH:mm:ss", example = "2020-01-01 00:00:00", hidden = true)
    private LocalDateTime time;
    //@ApiModelProperty(value = "创建人", hidden = true)
    private String createdBy;
    //@ApiModelProperty(value = "最后修改人", hidden = true)
    private String modifiedBy;
    //@ApiModelProperty(value = "版本")
    private Integer version;
}
